为平台中存在的边缘节点设备分配路由实例,实现边缘节点侧设备上报数据转发。同时边缘节点侧的数据也可以转发到云平台,方便在云端进一步对数据做监控与分析。
功能描述:分配路由实例至指定的边缘节点。
POST /api/v1/routers/gateway/association
Body:
| Name | Type | Description | Required |
|---|---|---|---|
| devId | string | 边缘节点ID | Yes |
| exportClientId | int[] | 路由实例ID数组 | Yes |
Body example:
{
"devId": "10001085",
"exportClientId": [10269]
}
cURL example:
curl --location --request POST '{URI-scheme}://{Endpoint}{path-prefix}/api/v1/routers/gateway/association?accessKeyId={accessKeyId}&signatureNonce=266&signature={signature}' \
--header 'platform: 3' \
--header 'projectId: {projectId}' \
--header 'Content-Type: application/json' \
--data-raw '{
"devId": "10001085",
"exportClientId": [10269]
}'
Response example:
{
"data": null,
"success": true,
"code": 0,
"msg": null
}
功能描述:移除某个已分配的路由实例。
DELETE /api/v1/routers/gateway/disassociation/{exportClientId}/{devId}
Path:
| Name | Type | Description | Required |
|---|---|---|---|
| exportClientId | string | 路由实例ID | Yes |
| devId | string | 边缘节点ID | Yes |
cURL example:
curl --location --request DELETE '{URI-scheme}://{Endpoint}{path-prefix}/api/v1/routers/gateway/disassociation/10269/10001085?accessKeyId={accessKeyId}&signatureNonce=651&signature={signature}' \
--header 'platform: 3' \
--header 'projectId: {projectId}'
Response example:
{
"data": null,
"success": true,
"code": 0,
"msg": null
}
功能描述:分页查询当前已分配至边缘节点的边缘执行环境的路由实例。
GET /api/v1/routers/gateway/association
Query:
| Name | Type | Description | Required |
|---|---|---|---|
| currentPage | string | 当前页码 | Yes |
| pageSize | string | 页码大小 | Yes |
| deviceId | int | 边缘节点ID | Yes |
| name | string | 路由实例名称 | No |
cURL example:
curl --location --request GET '{URI-scheme}://{Endpoint}{path-prefix}/api/v1/routers/gateway/association?accessKeyId={accessKeyId}&signatureNonce=371&signature={signature}¤tPage=1&pageSize=5&deviceId=10001085&name=rou' \
--header 'platform: 3' \
--header 'projectId: {projectId}'
Response data:
| Name | Type | Description |
|---|---|---|
| currentPage | int | 当前页数 |
| pageSize | int | 每页数量 |
| totalCount | int | 符合条件的总数量 |
| totalPage | int | 符合条件的总页数 |
| content | struct[] | 本页数据列表 |
Response data content:
| Name | Type | Description |
|---|---|---|
| id | string | 路由实例ID |
| addressConfigId | int | 目的地址配置ID |
| addressConfigName | string | 空(暂不提供值) |
| addressType | int | 目的地址配置类型,具体含义可参考创建目的地址配置 |
| compression | int | 数据压缩方式 |
| created | long | 创建时间,单位毫秒 |
| encryption | struct | 加密规则结构体 |
| env | int | 执行环境,1:云端,2:边缘端 |
| filter | struct | 过滤器结构体 |
| format | int | 数据格式 |
| modified | long | 修改时间,单位毫秒 |
| name | string | 实例名称 |
| type | int | 实例类型(1:标准数据转发/2:规则引擎配置类型/3:数据分析配置类型) |
| status | int | 边缘端执行环境此字段无意义 |
Response data content filter结构体:
| Name | Type | Description |
|---|---|---|
| devIdentifiers | struct[] | 过滤规则结构体 |
Response data content filter devIdentifiers结构体:
| Name | Type | Description |
|---|---|---|
| pid | string | 产品ID的字符串 |
| productName | string | 产品名 |
| protocolType | int | 产品协议类型 |
| deviceId | string | 设备ID字符串 |
| deviceName | string | 设备名 |
| valueDescriptorIdentifiers | string[] | 需过滤的属性名(必须首先设置设备ID) |
| identifierType | int | 标识符类型(0:属性、1:事件) |
Response data content encryption结构体:
| Name | Type | Description |
|---|---|---|
| encryptionAlgorithm | int | 加密方式(1:NONE / 2:AES), 目前只支持AES, NONE表示不加密。 |
| encryptionKey | string | AES加密Key |
| initializingVector | string | 初始化向量 |
Response example:
{
"data": {
"currentPage": 1,
"pageSize": 5,
"totalCount": 1,
"totalPage": 1,
"content": [
{
"id": 10269,
"addressConfigId": 13405,
"addressConfigName": "",
"addressType": 2,
"compression": 1,
"created": 1589437844570,
"encryption": {
"encryptionAlgorithm": 1,
"encryptionKey": null,
"initializingVector": null
},
"env": 2,
"filter": {
"devIdentifiers": null
},
"format": 3,
"modified": 1589437844570,
"name": "rule_router1",
"type": 2,
"userId": "bb5f2d0f4fad4d2ab1897d3fdca7c5c3",
"status": 3,
"platform": 2,
"ownerName": null
}
]
},
"success": true,
"code": 0,
"msg": null
}
功能描述:分页查询未分配至边缘节点的边缘执行环境的路由实例。
GET /api/v1/routers/gateway/unassignedclient
Query:
| Name | Type | Description | Required |
|---|---|---|---|
| currentPage | string | 当前页码 | Yes |
| pageSize | string | 页码大小 | Yes |
| deviceId | int | 边缘节点ID | Yes |
| name | string | 路由实例名称 | No |
cURL example:
curl --location --request GET '{URI-scheme}://{Endpoint}{path-prefix}/api/v1/routers/gateway/unassignedclient?accessKeyId={accessKeyId}&signatureNonce=371&signature={signature}¤tPage=1&pageSize=5&deviceId=10001085&name=rou' \
--header 'platform: 3' \
--header 'projectId: {projectId}'
Response data:
| Name | Type | Description |
|---|---|---|
| currentPage | int | 当前页数 |
| pageSize | int | 每页数量 |
| totalCount | int | 符合条件的总数量 |
| totalPage | int | 符合条件的总页数 |
| content | struct[] | 本页数据列表 |
Response data content:
| Name | Type | Description |
|---|---|---|
| id | string | 路由实例ID |
| addressConfigId | int | 目的地址配置ID |
| addressConfigName | string | 空(暂不提供值) |
| addressType | int | 目的地址配置类型,具体含义可参考创建目的地址配置 |
| compression | int | 数据压缩方式 |
| created | long | 创建时间,单位毫秒 |
| encryption | struct | 加密规则结构体 |
| env | int | 执行环境,1:云端,2:边缘端 |
| filter | struct | 过滤器结构体 |
| format | int | 数据格式 |
| modified | long | 修改时间,单位毫秒 |
| name | string | 实例名称 |
| type | int | 实例类型(1:标准数据转发/2:规则引擎配置类型/3:数据分析配置类型) |
| status | int | 边缘端执行环境此字段无意义 |
Response data content filter结构体:
| Name | Type | Description |
|---|---|---|
| devIdentifiers | struct[] | 过滤规则结构体 |
Response data content filter devIdentifiers结构体:
| Name | Type | Description |
|---|---|---|
| pid | string | 产品ID的字符串 |
| productName | string | 产品名 |
| protocolType | int | 产品协议类型 |
| deviceId | string | 设备ID字符串 |
| deviceName | string | 设备名 |
| valueDescriptorIdentifiers | string[] | 需过滤的属性名(必须首先设置设备ID) |
| identifierType | int | 标识符类型(0:属性、1:事件) |
Response data content encryption结构体:
| Name | Type | Description |
|---|---|---|
| encryptionAlgorithm | int | 加密方式(1:NONE / 2:AES), 目前只支持AES, NONE表示不加密。 |
| encryptionKey | string | AES加密Key |
| initializingVector | string | 初始化向量 |
Response example:
{
"data": {
"currentPage": 1,
"pageSize": 5,
"totalCount": 1,
"totalPage": 1,
"content": [
{
"id": 10276,
"addressConfigId": 13407,
"addressConfigName": "",
"addressType": 4,
"compression": 1,
"created": 1589771376810,
"encryption": {
"encryptionAlgorithm": 1,
"encryptionKey": null,
"initializingVector": null
},
"env": 2,
"filter": {
"devIdentifiers": [
{
"deviceMap": {"10000156":"victor-project-mqtt_1"},
"deviceName": null,
"pid": "100655",
"productName": null,
"protocolType": 1,
"identifierType": 0,
"valueDescriptorIdentifiers": null
}
]
},
"format": 1,
"modified": 1589771376810,
"name": "standard_router8",
"type": 1,
"userId": "bb5f2d0f4fad4d2ab1897d3fdca7c5c3",
"status": 3,
"platform": 2,
"ownerName": null
}
]
},
"success": true,
"code": 0,
"msg": null
}